#!/usr/bin/env bash

main()
{
    a=110
    b=19
    (( c=a/b ))
    echo "$c = $a / $b"
    if (( a % b != 0 ))
    then
        echo "$a % $b != 0"
    fi
    (( d=(a-b)*c ))
    echo "$d = ($a - $b) * $c"

    # 0前导: 8进制
    s="0018"
    (( n=s ))
    echo "$s == $n"
    # 0x前导: 16进制
    s="0x0018"
    (( n=s ))
    echo "$s == $n"
    # [base#]n: base进制，无则10进制
    s="16#0018"
    (( n=s ))
    echo "$s == $n"
    # 10进制
    s="10#0018"
    (( n=s ))
    echo "$s == $n"

    # 绝对值
    local i=-100
    (( i<0 )) && (( i=-i ))
    echo $i
}

main
exit $?
